<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE BangPatterns, ScopedTypeVariables #-}</span><span>
</span><span id="line-2"></span><span>
</span><span id="line-3"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-4"></span><span class="hs-comment">-- Module      : Data.Text.Internal.Search</span><span>
</span><span id="line-5"></span><span class="hs-comment">-- Copyright   : (c) Bryan O'Sullivan 2009</span><span>
</span><span id="line-6"></span><span class="hs-comment">--</span><span>
</span><span id="line-7"></span><span class="hs-comment">-- License     : BSD-style</span><span>
</span><span id="line-8"></span><span class="hs-comment">-- Maintainer  : bos@serpentine.com</span><span>
</span><span id="line-9"></span><span class="hs-comment">-- Stability   : experimental</span><span>
</span><span id="line-10"></span><span class="hs-comment">-- Portability : GHC</span><span>
</span><span id="line-11"></span><span class="hs-comment">--</span><span>
</span><span id="line-12"></span><span class="hs-comment">-- Fast substring search for 'Text', based on work by Boyer, Moore,</span><span>
</span><span id="line-13"></span><span class="hs-comment">-- Horspool, Sunday, and Lundh.</span><span>
</span><span id="line-14"></span><span class="hs-comment">--</span><span>
</span><span id="line-15"></span><span class="hs-comment">-- References:</span><span>
</span><span id="line-16"></span><span class="hs-comment">--</span><span>
</span><span id="line-17"></span><span class="hs-comment">-- * R. S. Boyer, J. S. Moore: A Fast String Searching Algorithm.</span><span>
</span><span id="line-18"></span><span class="hs-comment">--   Communications of the ACM, 20, 10, 762-772 (1977)</span><span>
</span><span id="line-19"></span><span class="hs-comment">--</span><span>
</span><span id="line-20"></span><span class="hs-comment">-- * R. N. Horspool: Practical Fast Searching in Strings.  Software -</span><span>
</span><span id="line-21"></span><span class="hs-comment">--   Practice and Experience 10, 501-506 (1980)</span><span>
</span><span id="line-22"></span><span class="hs-comment">--</span><span>
</span><span id="line-23"></span><span class="hs-comment">-- * D. M. Sunday: A Very Fast Substring Search Algorithm.</span><span>
</span><span id="line-24"></span><span class="hs-comment">--   Communications of the ACM, 33, 8, 132-142 (1990)</span><span>
</span><span id="line-25"></span><span class="hs-comment">--</span><span>
</span><span id="line-26"></span><span class="hs-comment">-- * F. Lundh: The Fast Search Algorithm.</span><span>
</span><span id="line-27"></span><span class="hs-comment">--   &lt;http://effbot.org/zone/stringlib.htm&gt; (2006)</span><span>
</span><span id="line-28"></span><span>
</span><span id="line-29"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">Data.Text.Internal.Search</span><span>
</span><span id="line-30"></span><span>    </span><span class="hs-special">(</span><span>
</span><span id="line-31"></span><span>      </span><span class="annot"><a href="Data.Text.Internal.Search.html#indices"><span class="hs-identifier">indices</span></a></span><span>
</span><span id="line-32"></span><span>    </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-33"></span><span>
</span><span id="line-34"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="Data.Text.Array.html"><span class="hs-identifier">Data.Text.Array</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">A</span></span><span>
</span><span id="line-35"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Word.html#"><span class="hs-identifier">Data.Word</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Word.html#Word64"><span class="hs-identifier">Word64</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word16"><span class="hs-identifier">Word16</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-36"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Data.Text.Internal.html"><span class="hs-identifier">Data.Text.Internal</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.html#Text"><span class="hs-identifier">Text</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-37"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Bits.html#"><span class="hs-identifier">Data.Bits</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Bits.html#.%7C."><span class="hs-operator">(.|.)</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/Data.Bits.html#.%26."><span class="hs-operator">(.&amp;.)</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-38"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Data.Text.Internal.Unsafe.Shift.html"><span class="hs-identifier">Data.Text.Internal.Unsafe.Shift</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.Unsafe.Shift.html#shiftL"><span class="hs-identifier">shiftL</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-39"></span><span>
</span><span id="line-40"></span><span class="hs-keyword">data</span><span> </span><span id="T"><span class="annot"><a href="Data.Text.Internal.Search.html#T"><span class="hs-identifier hs-var">T</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-pragma">{-# UNPACK</span><span> </span><span class="hs-pragma">#-}</span><span> </span><span class="hs-glyph">!</span><span class="annot"><a href="../../base/src/GHC.Word.html#Word64"><span class="hs-identifier hs-type">Word64</span></a></span><span> </span><span id="%3A%2A"><span class="annot"><a href="Data.Text.Internal.Search.html#%3A%2A"><span class="hs-operator hs-var">:*</span></a></span></span><span> </span><span class="hs-pragma">{-# UNPACK</span><span> </span><span class="hs-pragma">#-}</span><span> </span><span class="hs-glyph">!</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span>
</span><span id="line-41"></span><span>
</span><span id="line-42"></span><span class="hs-comment">-- | /O(n+m)/ Find the offsets of all non-overlapping indices of</span><span>
</span><span id="line-43"></span><span class="hs-comment">-- @needle@ within @haystack@.  The offsets returned represent</span><span>
</span><span id="line-44"></span><span class="hs-comment">-- uncorrected indices in the low-level \&quot;needle\&quot; array, to which its</span><span>
</span><span id="line-45"></span><span class="hs-comment">-- offset must be added.</span><span>
</span><span id="line-46"></span><span class="hs-comment">--</span><span>
</span><span id="line-47"></span><span class="hs-comment">-- In (unlikely) bad cases, this algorithm's complexity degrades</span><span>
</span><span id="line-48"></span><span class="hs-comment">-- towards /O(n*m)/.</span><span>
</span><span id="line-49"></span><span class="annot"><a href="Data.Text.Internal.Search.html#indices"><span class="hs-identifier hs-type">indices</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Text.Internal.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>                </span><span class="hs-comment">-- ^ Substring to search for (@needle@)</span><span>
</span><span id="line-50"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>                </span><span class="hs-comment">-- ^ Text to search in (@haystack@)</span><span>
</span><span id="line-51"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-52"></span><span id="indices"><span class="annot"><span class="annottext">indices :: Text -&gt; Text -&gt; [Int]
</span><a href="Data.Text.Internal.Search.html#indices"><span class="hs-identifier hs-var hs-var">indices</span></a></span></span><span> </span><span id="local-6989586621679105320"><span class="annot"><span class="annottext">_needle :: Text
</span><a href="#local-6989586621679105320"><span class="hs-identifier hs-var">_needle</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span id="local-6989586621679105318"><span class="annot"><span class="annottext">Array
</span><a href="#local-6989586621679105318"><span class="hs-identifier hs-var">narr</span></a></span></span><span> </span><span id="local-6989586621679105317"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679105317"><span class="hs-identifier hs-var">noff</span></a></span></span><span> </span><span id="local-6989586621679105316"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679105316"><span class="hs-identifier hs-var">nlen</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679105315"><span class="annot"><span class="annottext">_haystack :: Text
</span><a href="#local-6989586621679105315"><span class="hs-identifier hs-var">_haystack</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span id="local-6989586621679105314"><span class="annot"><span class="annottext">Array
</span><a href="#local-6989586621679105314"><span class="hs-identifier hs-var">harr</span></a></span></span><span> </span><span id="local-6989586621679105313"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679105313"><span class="hs-identifier hs-var">hoff</span></a></span></span><span> </span><span id="local-6989586621679105312"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679105312"><span class="hs-identifier hs-var">hlen</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-53"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679105316"><span class="hs-identifier hs-var">nlen</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span>              </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Word16 -&gt; [Int]
</span><a href="#local-6989586621679105311"><span class="hs-identifier hs-var">scanOne</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Word16
</span><a href="#local-6989586621679105310"><span class="hs-identifier hs-var">nindex</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span class="hs-special">)</span><span>
</span><span id="line-54"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679105316"><span class="hs-identifier hs-var">nlen</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3C%3D"><span class="hs-operator hs-var">&lt;=</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%7C%7C"><span class="hs-operator hs-var">||</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679105307"><span class="hs-identifier hs-var">ldiff</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3C"><span class="hs-operator hs-var">&lt;</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-55"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>              </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; [Int]
</span><a href="#local-6989586621679105305"><span class="hs-identifier hs-var">scan</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span>
</span><span id="line-56"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-57"></span><span>    </span><span id="local-6989586621679105307"><span class="annot"><span class="annottext">ldiff :: Int
</span><a href="#local-6989586621679105307"><span class="hs-identifier hs-var hs-var">ldiff</span></a></span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679105312"><span class="hs-identifier hs-var">hlen</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679105316"><span class="hs-identifier hs-var">nlen</span></a></span><span>
</span><span id="line-58"></span><span>    </span><span id="local-6989586621679105301"><span class="annot"><span class="annottext">nlast :: Int
</span><a href="#local-6989586621679105301"><span class="hs-identifier hs-var hs-var">nlast</span></a></span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679105316"><span class="hs-identifier hs-var">nlen</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span>
</span><span id="line-59"></span><span>    </span><span id="local-6989586621679105300"><span class="annot"><span class="annottext">z :: Word16
</span><a href="#local-6989586621679105300"><span class="hs-identifier hs-var hs-var">z</span></a></span></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Word16
</span><a href="#local-6989586621679105310"><span class="hs-identifier hs-var">nindex</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679105301"><span class="hs-identifier hs-var">nlast</span></a></span><span>
</span><span id="line-60"></span><span>    </span><span id="local-6989586621679105310"><span class="annot"><span class="annottext">nindex :: Int -&gt; Word16
</span><a href="#local-6989586621679105310"><span class="hs-identifier hs-var hs-var">nindex</span></a></span></span><span> </span><span id="local-6989586621679105298"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679105298"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Array -&gt; Int -&gt; Word16
</span><a href="Data.Text.Array.html#unsafeIndex"><span class="hs-identifier hs-var">A.unsafeIndex</span></a></span><span> </span><span class="annot"><span class="annottext">Array
</span><a href="#local-6989586621679105318"><span class="hs-identifier hs-var">narr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679105317"><span class="hs-identifier hs-var">noff</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679105298"><span class="hs-identifier hs-var">k</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-61"></span><span>    </span><span id="local-6989586621679105294"><span class="annot"><span class="annottext">hindex :: Int -&gt; Word16
</span><a href="#local-6989586621679105294"><span class="hs-identifier hs-var hs-var">hindex</span></a></span></span><span> </span><span id="local-6989586621679105293"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679105293"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Array -&gt; Int -&gt; Word16
</span><a href="Data.Text.Array.html#unsafeIndex"><span class="hs-identifier hs-var">A.unsafeIndex</span></a></span><span> </span><span class="annot"><span class="annottext">Array
</span><a href="#local-6989586621679105314"><span class="hs-identifier hs-var">harr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679105313"><span class="hs-identifier hs-var">hoff</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679105293"><span class="hs-identifier hs-var">k</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-62"></span><span>    </span><span id="local-6989586621679105288"><span class="annot"><span class="annottext">hindex' :: Int -&gt; Word16
</span><a href="#local-6989586621679105288"><span class="hs-identifier hs-var hs-var">hindex'</span></a></span></span><span> </span><span id="local-6989586621679105287"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679105287"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679105287"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679105312"><span class="hs-identifier hs-var">hlen</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Word16
</span><span class="hs-number">0</span></span><span>
</span><span id="line-63"></span><span>              </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Array -&gt; Int -&gt; Word16
</span><a href="Data.Text.Array.html#unsafeIndex"><span class="hs-identifier hs-var">A.unsafeIndex</span></a></span><span> </span><span class="annot"><span class="annottext">Array
</span><a href="#local-6989586621679105314"><span class="hs-identifier hs-var">harr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679105313"><span class="hs-identifier hs-var">hoff</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679105287"><span class="hs-identifier hs-var">k</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-64"></span><span>    </span><span id="local-6989586621679105280"><span class="annot"><span class="annottext">buildTable :: Int -&gt; Word64 -&gt; Int -&gt; T
</span><a href="#local-6989586621679105280"><span class="hs-identifier hs-var hs-var">buildTable</span></a></span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621679105279"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679105279"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621679105278"><span class="annot"><span class="annottext">Word64
</span><a href="#local-6989586621679105278"><span class="hs-identifier hs-var">msk</span></a></span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621679105277"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679105277"><span class="hs-identifier hs-var">skp</span></a></span></span><span>
</span><span id="line-65"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679105279"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3E%3D"><span class="hs-operator hs-var">&gt;=</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679105301"><span class="hs-identifier hs-var">nlast</span></a></span><span>           </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word64
</span><a href="#local-6989586621679105278"><span class="hs-identifier hs-var">msk</span></a></span><span> </span><span class="annot"><span class="annottext">Word64 -&gt; Word64 -&gt; Word64
forall a. Bits a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/Data.Bits.html#.%7C."><span class="hs-operator hs-var">.|.</span></a></span><span> </span><span class="annot"><span class="annottext">Word16 -&gt; Word64
</span><a href="#local-6989586621679105276"><span class="hs-identifier hs-var">swizzle</span></a></span><span> </span><span class="annot"><span class="annottext">Word16
</span><a href="#local-6989586621679105300"><span class="hs-identifier hs-var">z</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Word64 -&gt; Int -&gt; T
</span><a href="Data.Text.Internal.Search.html#%3A%2A"><span class="hs-operator hs-var">:*</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679105277"><span class="hs-identifier hs-var">skp</span></a></span><span>
</span><span id="line-66"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Word64 -&gt; Int -&gt; T
</span><a href="#local-6989586621679105280"><span class="hs-identifier hs-var">buildTable</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679105279"><span class="hs-identifier hs-var">i</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word64
</span><a href="#local-6989586621679105278"><span class="hs-identifier hs-var">msk</span></a></span><span> </span><span class="annot"><span class="annottext">Word64 -&gt; Word64 -&gt; Word64
forall a. Bits a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/Data.Bits.html#.%7C."><span class="hs-operator hs-var">.|.</span></a></span><span> </span><span class="annot"><span class="annottext">Word16 -&gt; Word64
</span><a href="#local-6989586621679105276"><span class="hs-identifier hs-var">swizzle</span></a></span><span> </span><span class="annot"><span class="annottext">Word16
</span><a href="#local-6989586621679105275"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679105274"><span class="hs-identifier hs-var">skp'</span></a></span><span>
</span><span id="line-67"></span><span>        </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679105275"><span class="annot"><span class="annottext">c :: Word16
</span><a href="#local-6989586621679105275"><span class="hs-identifier hs-var hs-var">c</span></a></span></span><span>                </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Word16
</span><a href="#local-6989586621679105310"><span class="hs-identifier hs-var">nindex</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679105279"><span class="hs-identifier hs-var">i</span></a></span><span>
</span><span id="line-68"></span><span>              </span><span id="local-6989586621679105274"><span class="annot"><span class="annottext">skp' :: Int
</span><a href="#local-6989586621679105274"><span class="hs-identifier hs-var hs-var">skp'</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Word16
</span><a href="#local-6989586621679105275"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">Word16 -&gt; Word16 -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="annot"><span class="annottext">Word16
</span><a href="#local-6989586621679105300"><span class="hs-identifier hs-var">z</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679105316"><span class="hs-identifier hs-var">nlen</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679105279"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span>
</span><span id="line-69"></span><span>                   </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679105277"><span class="hs-identifier hs-var">skp</span></a></span><span>
</span><span id="line-70"></span><span>
</span><span id="line-71"></span><span>    </span><span class="annot"><a href="#local-6989586621679105276"><span class="hs-identifier hs-type">swizzle</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word16"><span class="hs-identifier hs-type">Word16</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word64"><span class="hs-identifier hs-type">Word64</span></a></span><span>
</span><span id="line-72"></span><span>    </span><span id="local-6989586621679105276"><span class="annot"><span class="annottext">swizzle :: Word16 -&gt; Word64
</span><a href="#local-6989586621679105276"><span class="hs-identifier hs-var hs-var">swizzle</span></a></span></span><span> </span><span id="local-6989586621679105268"><span class="annot"><span class="annottext">Word16
</span><a href="#local-6989586621679105268"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Word64
</span><span class="hs-number">1</span></span><span> </span><span class="annot"><span class="annottext">Word64 -&gt; Int -&gt; Word64
forall a. UnsafeShift a =&gt; a -&gt; Int -&gt; a
</span><a href="Data.Text.Internal.Unsafe.Shift.html#shiftL"><span class="hs-operator hs-var">`shiftL`</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word16 -&gt; Int
</span><a href="Data.Text.Internal.Search.html#word16ToInt"><span class="hs-identifier hs-var">word16ToInt</span></a></span><span> </span><span class="annot"><span class="annottext">Word16
</span><a href="#local-6989586621679105268"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Bits a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/Data.Bits.html#.%26."><span class="hs-operator hs-var">.&amp;.</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0x3f</span></span><span class="hs-special">)</span><span>
</span><span id="line-73"></span><span>
</span><span id="line-74"></span><span>    </span><span id="local-6989586621679105305"><span class="annot"><span class="annottext">scan :: Int -&gt; [Int]
</span><a href="#local-6989586621679105305"><span class="hs-identifier hs-var hs-var">scan</span></a></span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621679105262"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679105262"><span class="hs-identifier hs-var">i</span></a></span></span><span>
</span><span id="line-75"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679105262"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3E"><span class="hs-operator hs-var">&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679105307"><span class="hs-identifier hs-var">ldiff</span></a></span><span>                  </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-76"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Word16
</span><a href="#local-6989586621679105260"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">Word16 -&gt; Word16 -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="annot"><span class="annottext">Word16
</span><a href="#local-6989586621679105300"><span class="hs-identifier hs-var">z</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%26%26"><span class="hs-operator hs-var">&amp;&amp;</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Bool
</span><a href="#local-6989586621679105258"><span class="hs-identifier hs-var">candidateMatch</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679105262"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; [Int] -&gt; [Int]
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; [Int]
</span><a href="#local-6989586621679105305"><span class="hs-identifier hs-var">scan</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679105262"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679105316"><span class="hs-identifier hs-var">nlen</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-77"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>                  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; [Int]
</span><a href="#local-6989586621679105305"><span class="hs-identifier hs-var">scan</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679105262"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679105257"><span class="hs-identifier hs-var">delta</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-78"></span><span>        </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679105260"><span class="annot"><span class="annottext">c :: Word16
</span><a href="#local-6989586621679105260"><span class="hs-identifier hs-var hs-var">c</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Word16
</span><a href="#local-6989586621679105294"><span class="hs-identifier hs-var">hindex</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679105262"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679105301"><span class="hs-identifier hs-var">nlast</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-79"></span><span>              </span><span id="local-6989586621679105258"><span class="annot"><span class="annottext">candidateMatch :: Int -&gt; Bool
</span><a href="#local-6989586621679105258"><span class="hs-identifier hs-var hs-var">candidateMatch</span></a></span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621679105250"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679105250"><span class="hs-identifier hs-var">j</span></a></span></span><span>
</span><span id="line-80"></span><span>                    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679105250"><span class="hs-identifier hs-var">j</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3E%3D"><span class="hs-operator hs-var">&gt;=</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679105301"><span class="hs-identifier hs-var">nlast</span></a></span><span>               </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#True"><span class="hs-identifier hs-var">True</span></a></span><span>
</span><span id="line-81"></span><span>                    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Word16
</span><a href="#local-6989586621679105294"><span class="hs-identifier hs-var">hindex</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679105262"><span class="hs-identifier hs-var">i</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679105250"><span class="hs-identifier hs-var">j</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Word16 -&gt; Word16 -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%2F%3D"><span class="hs-operator hs-var">/=</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Word16
</span><a href="#local-6989586621679105310"><span class="hs-identifier hs-var">nindex</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679105250"><span class="hs-identifier hs-var">j</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-var">False</span></a></span><span>
</span><span id="line-82"></span><span>                    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>                </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Bool
</span><a href="#local-6989586621679105258"><span class="hs-identifier hs-var">candidateMatch</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679105250"><span class="hs-identifier hs-var">j</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span>
</span><span id="line-83"></span><span>              </span><span id="local-6989586621679105257"><span class="annot"><span class="annottext">delta :: Int
</span><a href="#local-6989586621679105257"><span class="hs-identifier hs-var hs-var">delta</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679105242"><span class="hs-identifier hs-var">nextInPattern</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679105316"><span class="hs-identifier hs-var">nlen</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span>
</span><span id="line-84"></span><span>                    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Word16
</span><a href="#local-6989586621679105260"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">Word16 -&gt; Word16 -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="annot"><span class="annottext">Word16
</span><a href="#local-6989586621679105300"><span class="hs-identifier hs-var">z</span></a></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679105241"><span class="hs-identifier hs-var">skip</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span>
</span><span id="line-85"></span><span>                    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span>
</span><span id="line-86"></span><span>                </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679105242"><span class="annot"><span class="annottext">nextInPattern :: Bool
</span><a href="#local-6989586621679105242"><span class="hs-identifier hs-var hs-var">nextInPattern</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Word64
</span><a href="#local-6989586621679105235"><span class="hs-identifier hs-var">mask</span></a></span><span> </span><span class="annot"><span class="annottext">Word64 -&gt; Word64 -&gt; Word64
forall a. Bits a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/Data.Bits.html#.%26."><span class="hs-operator hs-var">.&amp;.</span></a></span><span> </span><span class="annot"><span class="annottext">Word16 -&gt; Word64
</span><a href="#local-6989586621679105276"><span class="hs-identifier hs-var">swizzle</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Word16
</span><a href="#local-6989586621679105288"><span class="hs-identifier hs-var">hindex'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679105262"><span class="hs-identifier hs-var">i</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679105316"><span class="hs-identifier hs-var">nlen</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Word64 -&gt; Word64 -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="annot"><span class="annottext">Word64
</span><span class="hs-number">0</span></span><span>
</span><span id="line-87"></span><span>              </span><span class="hs-glyph">!</span><span class="hs-special">(</span><span id="local-6989586621679105235"><span class="annot"><span class="annottext">Word64
</span><a href="#local-6989586621679105235"><span class="hs-identifier hs-var">mask</span></a></span></span><span> </span><span class="annot"><a href="Data.Text.Internal.Search.html#%3A%2A"><span class="hs-operator hs-type">:*</span></a></span><span> </span><span id="local-6989586621679105241"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679105241"><span class="hs-identifier hs-var">skip</span></a></span></span><span class="hs-special">)</span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Word64 -&gt; Int -&gt; T
</span><a href="#local-6989586621679105280"><span class="hs-identifier hs-var">buildTable</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">Word64
</span><span class="hs-number">0</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679105316"><span class="hs-identifier hs-var">nlen</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span class="hs-special">)</span><span>
</span><span id="line-88"></span><span>    </span><span id="local-6989586621679105311"><span class="annot"><span class="annottext">scanOne :: Word16 -&gt; [Int]
</span><a href="#local-6989586621679105311"><span class="hs-identifier hs-var hs-var">scanOne</span></a></span></span><span> </span><span id="local-6989586621679105231"><span class="annot"><span class="annottext">Word16
</span><a href="#local-6989586621679105231"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; [Int]
</span><a href="#local-6989586621679105230"><span class="hs-identifier hs-var">loop</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span>
</span><span id="line-89"></span><span>        </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679105230"><span class="annot"><span class="annottext">loop :: Int -&gt; [Int]
</span><a href="#local-6989586621679105230"><span class="hs-identifier hs-var hs-var">loop</span></a></span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621679105223"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679105223"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679105223"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3E%3D"><span class="hs-operator hs-var">&gt;=</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679105312"><span class="hs-identifier hs-var">hlen</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-90"></span><span>                      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Word16
</span><a href="#local-6989586621679105294"><span class="hs-identifier hs-var">hindex</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679105223"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Word16 -&gt; Word16 -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="annot"><span class="annottext">Word16
</span><a href="#local-6989586621679105231"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679105223"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; [Int] -&gt; [Int]
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; [Int]
</span><a href="#local-6989586621679105230"><span class="hs-identifier hs-var">loop</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679105223"><span class="hs-identifier hs-var">i</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span>
</span><span id="line-91"></span><span>                      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; [Int]
</span><a href="#local-6989586621679105230"><span class="hs-identifier hs-var">loop</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679105223"><span class="hs-identifier hs-var">i</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span>
</span><span id="line-92"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Internal.Search.html#indices"><span class="hs-pragma hs-type">indices</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-93"></span><span>
</span><span id="line-94"></span><span class="annot"><a href="Data.Text.Internal.Search.html#word16ToInt"><span class="hs-identifier hs-type">word16ToInt</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word16"><span class="hs-identifier hs-type">Word16</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span>
</span><span id="line-95"></span><span id="word16ToInt"><span class="annot"><span class="annottext">word16ToInt :: Word16 -&gt; Int
</span><a href="Data.Text.Internal.Search.html#word16ToInt"><span class="hs-identifier hs-var hs-var">word16ToInt</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Word16 -&gt; Int
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span>
</span><span id="line-96"></span></pre></body></html>